package mshop.com.schild_kotlin.utils

import android.content.Context
import android.content.Intent
import android.os.Bundle
import mshop.com.schild_kotlin.activitys.VideoPlayerActivity
import mshop.com.schild_kotlin.entitys.ItemList
import mshop.com.schild_kotlin.entitys.PlayInfoBean

/**
 * Created by mayi on 2018/6/2.
 * @Autor CaiWF
 * @Email 401885064@qq.com
 * @TODO
 */
class ActivitysUtil {

    companion object {
        fun ToVideoPlayerActivity(mContext: Context, mEntity: ItemList?) {
            mEntity?.let {
                it.data.let {
                    val intent = Intent(mContext, VideoPlayerActivity::class.java)
                    val bundle = Bundle()
                    val playInfoBean = PlayInfoBean(it.cover.feed, it.title, it.author, it.playInfo)
                    bundle.putParcelable("playInfoBean", playInfoBean)
                    intent.putExtras(bundle)
                    mContext.startActivity(intent)
                }
            }
        }

    }

}